//////////////////////////////////////////////

function showSubMenu(correntObj) {
    var correntModuleNode = correntObj.parentNode.parentNode;
    var RootDiv = correntModuleNode.parentNode;
    for (var i = 0; i < RootDiv.childNodes.length; i ++) {
        if (RootDiv.childNodes[i] == correntModuleNode) {
            if (correntModuleNode.childNodes[1].style.display == "block") {
                correntModuleNode.childNodes[0].getElementsByTagName("IMG")[0].src = "../images/icon02.gif";
                correntModuleNode.childNodes[1].style.display = "none";
            } else {
                correntModuleNode.childNodes[0].getElementsByTagName("IMG")[0].src = "../images/icon01.gif";
                correntModuleNode.childNodes[1].style.display = "block";
                showMenuItem(correntModuleNode);
            }

        } else {
            RootDiv.childNodes[i].childNodes[0].getElementsByTagName("IMG")[0].src = "../images/icon02.gif";
            RootDiv.childNodes[i].childNodes[1].style.display = "none";
        }
    }
}

function showMenuItem(moduleDiv)
{  // alert(moduleDiv.id)
    var menuBarCellsArray = new Array();
    var menuBarCellsLinkArray = new Array();
    var subModule_div= moduleDiv.childNodes[1];
    //    alert(subModuleDiv.className)

    //var subModuleTableRows = subModuleTable.rows;
    //    alert(subModuleTableRows[0].cells[1].childNodes[0].href)
     var subMenuChildren = subModule_div.childNodes;
    for (var j = 0; j < subMenuChildren.length; j++) {
        menuBarCellsArray[j] = subMenuChildren[j].getElementsByTagName('a')[0].innerHTML;
        menuBarCellsLinkArray[j] = subMenuChildren[j].getElementsByTagName('a')[0].href;
    }
    //    alert(menuBarCellsLinkArray[2])
    var menuTable = this.parent.document.getElementById("menuBarTable");
    menuTable.deleteRow(-1);
    var newRow = menuTable.insertRow(-1);
    for (var i = 0; i < menuBarCellsArray.length; i++) {
        //alert(menuBarCellsLinkArray[i])
        var newCell = newRow.insertCell(-1);
        newCell.className = "menuBarTableCell";
        newCell.onmouseover = function() {
            menuBarTableCell_msOver(this);
        };
        newCell.onmouseout = function() {
            menuBarTableCell_msOut(this);
        };
        newCell.onclick = function() {
            menuBarTableCell_msClick(menuBarCellsLinkArray[this.cellIndex]);
        };
        newCell.innerHTML = menuBarCellsArray[i];
        newCell.href = menuBarCellsLinkArray[i];
    }

}

function menuBarTableCell_msOver(newCellObj) {
    newCellObj.className = "menuBarTableCell_msOver";
}
function menuBarTableCell_msOut(newCellObj) {
    newCellObj.className = "menuBarTableCell_msOut";
}
function menuBarTableCell_msClick(link) {
    this.parent.document.getElementById('frmRight').src = link;
}
//////////////////////////////////////////////

